<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Merchant Manager</title>
<link href="./style.css" rel="stylesheet">
</head>

<body>
	<div class="div-body">
		<div class="nav-title-bar">
			<span>AMC - Merchant System</span>
		</div>

		<div class="content-menu">
			<div class="content-menu">
				<ul class="content-menu-ul">
					<li>Welcome ${merchantName}</li>
					<li><img src="${merchantPic}"
						style="width: 200px; height: 120px" /></li>
					<li><input class="add-button" type="button" value="Logout"
						onclick="location='LogoutServlet'" /></li>
				</ul>
			</div>
		</div>
		<div class="content-content">
			<table align="center" border="1">
				<tbody>
					<tr>
						<th>Food Id</th>
						<th>Food Name</th>
						<th>Food Price</th>
						<th>Food Picture</th>
						<th>Food Type</th>
						<!-- <th>Merchant</th> -->
						<th>Operation</th>
					</tr>
					<c:forEach items="${foodsList}" var="food">
						<tr>
							<td>${food.getFoodId()}</td>
							<td>${food.getFoodName()}</td>
							<td>${food.getFoodPrice()}</td>
							<td><img src="${food.getFoodPic()}"
								style="width:100%; height:80px;" /></td>
							<td><c:forEach items="${foodTypesMap}" var="fm">
									<c:if test="${fm.key == food.getFoodFoodTypeId()}">
						${fm.value}
					</c:if>
								</c:forEach></td>
							<!-- <td><c:forEach items="${merchantsMap}" var="mm">
									<c:if test="${mm.key == food.getMerchantId()}">
						${mm.value}
					</c:if>
								</c:forEach></td> -->
							<td><input class="delete-button" type="button"
								value="Delete"
								onclick="location='DeleteFoodsServlet?foodId=${food.getFoodId()}'" />
								<input class="update-button" type="button" value="Update"
								onclick="location='UpdateFoodsContentServlet?foodId=${food.getFoodId()}'" /></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<input class="add-button" type="button" value="Add Food"
				onclick="location='AddFoodsContentServlet'" />
		</div>
	</div>
</body>
</html>